
package testing;

import java.io.IOException;

/**
 *
 * @author badi
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException, InterruptedException {
        if(args.length > 0){
            if(args[0].equalsIgnoreCase("eval"))
                Eval.main(shift(args));
            else if (args[0].equalsIgnoreCase("evalsimp"))
                EvalSimp.main(shift(args));
            else if (args[0].equalsIgnoreCase("gentraj"))
                genTraj.main(shift(args));
            else if (args[0].equalsIgnoreCase("reduce"))
                reduce.main(shift(args));
            else quit();
        }
        else quit();
    }

    static String help = "Need 'eval', 'evalsimp', 'gentraj', or 'reduce'";
    
    static void quit(){
        System.out.println(help);
        System.exit(42);
    }

    public static String[] shift(String[] args){
        if(args.length > 0){
            String[] shifted = new String[args.length - 1];
            for(int i = 1; i < args.length; i++){
                shifted[i-1] = args[i];
            }
            return shifted;
        }
        else return args;
    }

}
